/*
 * Copyright (C) 2018 Zhejiang xiaominfo Technology CO.,LTD.
 * All rights reserved.
 * Official Web Site: http://www.xiaominfo.com.
 * Developer Web Site: http://open.xiaominfo.com.
 */

package com.lishiots.cloud.datacenter.middleware.common;

import com.google.common.collect.Lists;
import springfox.documentation.builders.ResponseMessageBuilder;
import springfox.documentation.service.ResponseMessage;

import java.util.List;

/***
 *
 * @since:datacenter-parent 1.0
 * @author <a href="mailto:xiaoymin@foxmail.com">xiaoymin@foxmail.com</a> 
 * 2018/09/06 20:26
 */
public class SwaggerRoot {

    public List<ResponseMessage> globalResponseMessageCode(){
        List<ResponseMessage> responseMessages= Lists.newArrayList(
                new ResponseMessageBuilder().code(8200).message("操作成功").build());
        responseMessages.add(new ResponseMessageBuilder().code(8302).message("未登录").build());
        responseMessages.add(new ResponseMessageBuilder().code(8401).message("不允许的操作（指定了错误的HTTP方法或API）。").build());
        responseMessages.add(new ResponseMessageBuilder().code(8402).message("请求参数非法。").build());
        responseMessages.add(new ResponseMessageBuilder().code(8403).message("权限校验错误").build());
        responseMessages.add(new ResponseMessageBuilder().code(8404).message("没有找到资源").build());
        responseMessages.add(new ResponseMessageBuilder().code(8405).message("请求数据不存在").build());
        responseMessages.add(new ResponseMessageBuilder().code(8406).message("请求已超时").build());
        responseMessages.add(new ResponseMessageBuilder().code(8407).message("不允许删除").build());
        responseMessages.add(new ResponseMessageBuilder().code(8410).message("重复操作").build());
        responseMessages.add(new ResponseMessageBuilder().code(8500).message("服务器内部错误").build());
        return responseMessages;
    }
}
